package com.lc.demo.filter;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @Author: sakila
 * @Date: 2022/03/06/16:54
 * @Description:
 */
@EnableWebMvc
@Configuration
public class WebConfig  extends WebMvcConfigurerAdapter {
    @Bean
    LoginHandlerInterceptor loginHandlerInterceptor(){
        return new LoginHandlerInterceptor();
    }


    public void  addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(loginHandlerInterceptor());
    }
}
